import logging,yagmail
from BeautifulReport import BeautifulReport
class Tool():
    def log(self):
        log=logging.basicConfig(level=logging.INFO,
                                format='%(levelname)S->%(filename)S->%(asctime)S->%(lineno)d',
                                filename='baidufirstpagewebtestlog.log.text',
                                filemode='a+')
        return log
    def send_email(self,filename):
        send=yagmail.SMTP(user='3177622011@qq.com',password='xjwzrxaryqjydece',host='smtp.qq.com')
        send.send(to='3177622011@qq.com',subject='百度WebFirstPage Ui自动化测试报告',attachments=filename,contents='大帝大弟')

    def baogao(self,suite):
        BeautifulReport(suite).report(filename='百度测试报告',description='大葱拌豆腐')